package com.design.bridge.file;

public class BridgeDemo {
    public static void main(String[] args) {
        // 创建 Windows 文件系统
        FileSystem windowsFileSystem = new WindowsFileSystem();

        // 使用本地硬盘存储文件
        StorageMedium localDisk = new LocalDisk(windowsFileSystem);

        // 文件名
        String fileName = "file.txt";
        localDisk.storeFile(fileName, "File content for local disk");
        String content = localDisk.retrieveFile(fileName);
        System.out.println("File content retrieved: " + content);

        System.out.println("--------------------------");

        // 使用网络存储文件
        StorageMedium networkStorage = new NetworkStorage(windowsFileSystem);
        networkStorage.storeFile(fileName, "File content for network storage");
        content = networkStorage.retrieveFile(fileName);
        System.out.println("File content retrieved: " + content);
    }
}
